﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using NHTools.Entity;

namespace NHTools.Map
{
    public class FirstTableMap: ClassMap<FirstTable>
    {
        public FirstTableMap()
        {
            Id(x => x.Id);
            //Map(x => x.ModifiedDate);
            //Map(x => x.CreatedDate);
            Map(x => x.NoteContent);
            Map(x => x.Status);
            
            HasMany(x => x.ChildsTable)
                .Cascade.SaveUpdate()
                .Not.LazyLoad()
                .AsBag();
            HasManyToMany(x => x.Discounts)
                .Table("TourDiscount")
                .Cascade.SaveUpdate()
                .AsBag();
        }

    }
}
